package ZombieCaminando;
import java.awt.FlowLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Ventana extends javax.swing.JFrame {
	
	protected Juego miJuego;
	private JPanel jPanel1;
	private JButton jButton1;
	private Fondo fondo_IL;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				Ventana inst = new Ventana();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public Ventana() {
		super("Zombie Caminando"); 
		initGUI();
		Juego miJuego = new Juego(this);
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setSize(640,480);
			getContentPane().setLayout(null);
			this.setVisible(true);
			{
				jButton1 = new JButton();
				getContentPane().add(jButton1);
				BoxLayout jButton1Layout = new BoxLayout(jButton1, javax.swing.BoxLayout.Y_AXIS);
				jButton1.setLayout(jButton1Layout);
				jButton1.setText("Reiniciar");
				jButton1.setLocation(getHeight()/2,getWidth()/2);
				jButton1.setVisible(false);
				jButton1.setBounds(240, 200, 127, 35);
				jButton1.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						jButton1MouseClicked(evt);
					}
				});
			}
			
			{
				fondo_IL = new Fondo("esp.jpg");
				setContentPane(fondo_IL);
				fondo_IL.setBounds(0, 2, 624, 442);
			}
			pack();
			this.setSize(640,480);
			
		} catch (Exception e) {
			// add your error handling code here
			e.printStackTrace();
		}		

	}
	
	public void perdio(){
		fondo_IL = new Fondo("Perdiste.jpg");
		fondo_IL.setBounds(0, -6, 624, 442);
		fondo_IL.setOpaque(true);
		setContentPane(fondo_IL);
		getContentPane().add(jButton1);
		jButton1.setVisible(true);
		

	}
	
	private void jButton1MouseClicked(MouseEvent evt) {
		initGUI();
		Juego miJuego = new Juego(this);
	}
	

}
